/**
 * @param {string} s
 * @param {string} t
 * @return {boolean}
 */
 var isSubsequence = function(s, t) {
  let dp = new Array(s.length+1).fill(0).map(()=>new Array(t.length+1).fill(0))
  for(let i = 1;i <= s.length;i++){
    for(let j = 1;j <= t.length;j++){
      if(s[i-1] === t[j-1]){
        dp[i][j] = dp[i-1][j-1]+1
      }else{
        dp[i][j] = Math.max(dp[i][j-1],dp[i-1][j])
      }
    }
  }
  for(let i = 0;i <= t.length;i++){
    if(dp[s.length][i] !== 0){
      return true
    }
  }
  return false
};